import axios from '@/libs/api.request'

/**
 * 获取上传的token数据
 * @returns {wx.RequestTask | never}
 */
export const getToken = (pre) => {
  return axios.request({
    url: 'OSS/token?dir='+pre,
    method: 'get'
  })
}

export const del = (key) => {
  return axios.request({
    url: 'OSS/del',
    method: 'get',
    params: {
      key: key
    }
  })
}
/**
 * 获取配置
 * @returns {wx.RequestTask | never}
 */
export const get = () => {
  return axios.request({
    url: 'Oss/get',
    method: 'get'
  })
}
/**
 * 保存配置
 * @returns {wx.RequestTask | never}
 */
export const save = (data) => {
  return axios.request({
    url: 'Oss/save',
    method: 'post',
    data
  })
}
